<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>文件下载</title>
</head>
<body>
<h2>文件上传</h2>
<form th:action="@{/user/upload}" method="post" enctype="multipart/form-data">
    <input type="file" name="file"/>
    <button type="submit">上传</button>
</form>
<h2>可下载文件列表</h2>
<div th:if="${files != null && files.length > 0}">
    <ul>
        <li th:each="file : ${files}">
            <a th:href="@{/user/download/{fileName}(fileName=${file.name})}"
               th:text="${file.name}">文件名</a>
        </li>
    </ul>
</div>
<div th:if="${files == null ||files.length == 0}">
    <p>暂无可下载文件</p>
</div>
<div>
    <a href="/user/list">返回用户列表</a>
</div>
</body>
</html> 